package spring.framework.beans.factory.support;

import spring.framework.beans.BeansException;
import spring.framework.beans.factory.config.BeanDefinition;

/**
 * @author fun.pengzh
 * @class spring.framework.beans.factory.support.BeanDefinitionRegisty
 * @desc
 * @since 2021-09-30
 */
public interface BeanDefinitionRegistry {

    /**
     * 向容器注册 BeanDefinition
     *
     * @param beanName
     * @param beanDefinition
     */
    void registerBeanDefinition(String beanName, BeanDefinition beanDefinition);

    /**
     * 根据 beanName 获取BeanDefinition
     *
     * @param beanName
     * @return
     * @throws BeansException
     */
    BeanDefinition getBeanDefinition(String beanName) throws BeansException;

    /**
     * 判断是否包含指定名称的BeanDefinition
     *
     * @param beanName
     * @return
     */
    boolean containsBeanDefinition(String beanName);

    /**
     * 获取所有的BeanDefinition名称数组
     *
     * @return
     */
    String[] getBeanDefinitionNames();
}
